const app = getApp();
console.log(app.globalData.userInfo)
import request from "./../utils/request.js";
/**
 * 加入购物车接口
 * @param object data
*/
export function cartAddBox(data){
  return request.post('cart/add',data);
}
/**
 * 确认订单
 * @param object data
*/
export function orderSure(data){
  return request.post('order/confirm',data);
}
/**
 * 生成订单
 * @param object data
*/
export function orderCreate(orderKey){
  return request.post(`order/create/${orderKey}`,{
    addressId: 0,
    bargainId: 0,
    combinationId: 0,
    couponId: 0,
    formId: "the formId is a mock one",
    from: "routine",
    mark: "",
    payType: "weixin",
    phone: app.globalData.userInfo['uid'],
    pinkId: 0,
    real_name: app.globalData.userInfo['nickname'],
    seckill_id: 0,
    shipping_type: 0,
    useIntegral: false
  });
}
/**
 * 订单详情
 * @param object data
*/
export function orderDetail(orderid){
  return request.post(`product/report/${orderid}`);
}
/**
 * 消息通知
 * @param object data
*/
export function noticeNews(){
  return request.get(`indexnews`,{},{ noAuth : true});
}